<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/common/topBegin.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/Validform.css"/>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/right_yz.css"/>
 <script type="text/javascript" src="${ctx}/js/jquery-1.7.1.min.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/Validform_v5.3.2.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/right_Validform_v5.3.2_config.js"></script>
 <script type="text/javascript" src="${ctx}/js/ajaxfileupload.js"></script>
 <script type="text/javascript" src="${ctx}/js/extjs/ext-base.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ext-all.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ui/ext-ui.js"></script>
<script type="text/javascript" src="${ctx}/js/public/console.js"></script>
<script type="text/javascript" src="${ctx}/js/extjs/ux/Toast.js"></script>
<script>
var cfg = {cxt:'${ctx}'};
<c:if test="${not empty entity}">
	<c:set var="url" value="shipOrder/update.action"/>
</c:if>
<c:if test="${ empty entity}">
<c:set var="url" value="shipOrder/add.action"/>
</c:if>
</script>
</head>
<body>
	<div id="table_form_div" class="table_form1">
		<form action="${ctx}/${url}" method="post" id="formobj"
			enctype="multipart/form-data">
			<input type="hidden" id="subBtn" /> <input type="hidden"
				id="backTip" value="操作成功" />
			<table class="table-form" width="100%">
				<tbody>
					<tr>
						<td width="15%" colspan="2" class="table-th">托运方<font
							color="red">*</font></td>
						<td class="table-td" width="35%">
							<input type="text" id="companyName"  name="shipper.company.name" value="" class="input-text" datatype="*" maxlength="64"  style="width:90%"/>
						<td width="15%" class="table-th">托运日期<font color="red">*</font></td>
						<td colspan="2" class="table-td" width="35%">
							<span id="shipTime"></span>
							<input type="hidden" id="hid_shipTime" value="${entity.shipTime}" />
						</td>
					<tr>
					<tr>
						<td colspan="2" width="15%" class="table-th">装货时间<font
							color="red">*</font></td>
						<td class="table-td" width="35%">
							<span id="loadGoodsTime"></span>
							<input type="hidden" id="hid_loadGoodsTime" value="${entity.loadGoodsTime}" />
							</td>
						<td width="15%" class="table-th">卸货时间<font color="red">*</font></td>
						<td colspan="2" class="table-td" width="35%">
							<span id="unloadGoodsTime"></span>
							<input type="hidden" id="hid_unloadGoodsTime" value="${entity.unloadGoodsTime}" />
						</td>
					</tr>
				     <tr>
				     	 <td  colspan="7">
				     	 	<table id="sendSite_Tab" class="table-form" width="100%">
				     	 		<tr rowspan="2"><td class="table-th" colspan="7" align="center">发货基本信息</td></tr>
				     	 	    <tr>
					     	 		<td  class="table-th" width="15%" align="center">发货点</td>
					     	 		<td colspan="2" class="table-th" width="25%" align="center">发货省市</td>
					     	 		<td colspan="2" class="table-th" width="25%" align="center">装货地址</td>
					     	 		<td class="table-th" width="10%" align="center">联系人</td>
					     	 		<td class="table-th" width="15%" align="center">联系电话</td>
					     	 	</tr>
					     	 	<tr>
					     	 		<td class="table-td"   width="15%">
					     	 			<input type="text" id="txt_sendSiteName_1" class="input-text" style="width:90%"  name="shipOrderSendSites[0].site.name"  value="" />
					     	 		</td>
					     	 		<td colspan="2" class="table-td"   width="25%">
					     	 			<select id="sendProvince" name="shipOrderSendSites[0].site.provinceId" style="width:30%;" datatype="*"></select>
					     	 			<input type="hidden" id="sendProvinceName" name="shipOrderSendSites[0].site.provinceName" />
							       	   	<span style="margin: 5px 5px;">
							       	   		<select id="sendCity" name="shipOrderSendSites[0].site.cityId" style="width:30%;display:none" datatype="*"></select>
							       	   		<input type="hidden" id="sendCityName" name="shipOrderSendSites[0].site.cityName" />
							       	   	</span>	
							       	   	<span style="margin:5px 5px;">
							       	   		<select id="sendArea" name="shipOrderSendSites[0].site.areaId" style="width:30%;display:none" datatype="*"></select>
							       	   		<input type="hidden" id="sendAreaName" name="shipOrderSendSites[0].site.areaName" />
							       		</span>
					     	 		</td>
					     	 		<td colspan="2" class="table-td"   width="25%">
								       	 <textArea id="loadAddress_1" class="textarea" style="width: 90%;" name="shipOrderSendSites[0].site.address" maxlength="100" datatype="*">${entity.shipOrderSendSites[0].address }</textArea>
								    </td>
								    <td class="table-td" width="10%">
				       	   				<input id="send_contractor_1" type="text"	style="width:90%;" class="input-text" name="shipOrderSendSites[0].site.contractor" maxlength="16" datatype="*" value=""/>
								    </td>
								    <td class="table-td" width="15%">
						       	   		<input id="send_contractPhone_1" type="text"	style="width:90%" class="input-text" name="shipOrderSendSites[0].site.contractPhone" maxlength="16" datatype="m|phone" value=""/>
						       	   	</td>
					     	 	</tr>
				     	 	</table>
				     	 </td>
					</tr>
					
					<!-- 收货信息 -->
					<tr>
						<td  colspan="7">
				     	 	<table id="receiveSite_Tab" class="table-form" width="100%">
				     	 		<tr rowspan="2"><td class="table-th" colspan="8" align="center">收货基本信息</td></tr>
				     	 		<tr>
					     	 		<td  class="table-th" width="15%" align="center">收货点 </td>
					     	 		<td colspan="2" class="table-th" width="25%" align="center">收货省市</td>
					     	 		<td colspan="2" class="table-th" width="25%" align="center">卸货地址</td>
					     	 		<td class="table-th" width="10%" align="center">联系人</td>
					     	 		<td class="table-th" width="15%" align="center">联系电话</td>
					     	 	</tr>
					     	 	<tr>
					     	 		<td class="table-td"   width="15%">
					     	 			<input type="text" id="txt_receiveSiteName_1"  class="input-text" style="width:90%"  name="shipOrderReceiveSites[0].site.name"  value="" />
					     	 		</td>
					     	 		<td colspan="2" class="table-td"   width="25%">
						       	   		<select id="receiveProvince" name="shipOrderReceiveSites[0].site.provinceId" style="width:30%;" datatype="*"></select>
						       	   		<input type="hidden" id="receiveProvinceName" name="shipOrderReceiveSites[0].site.provinceName" />
							       	   	<span style="margin: 5px 5px;">
							       	   		<select id="receiveCity" name="hipOrderReceiveSites[0].site.cityId" style="width:30%;display:none;" datatype="*"></select>
							       	   		<input type="hidden" id="receiveCityName" name="shipOrderReceiveSites[0].site.cityName" />
							       	   	</span>
							       	   	<span style="margin:5px 5px;">
							       	   		<select id="receiveArea" name="shipOrderReceiveSites[0].site.areaId" style="width:30%;display:none;" datatype="*"></select>
							       	   		<input type="hidden" id="receiveAreaName" name="shipOrderReceiveSites[0].site.areaName" />
							       		</span>
						       	   		
					     	 		</td>
				     	 			<td colspan="2" class="table-td"   width="25%">
						       	   		<textArea id="unloadAddress_1" class="textarea" style="width: 90%;" name="shipOrderReceiveSites[0].site.address" maxlength="100"  datatype="*"></textArea>
						       	   	</td>
						       	   	<td class="table-td" width="10%">
						       	   		<input id="receive_contractor_1" type="text"	style="width:90%;" class="input-text" name="shipOrderReceiveSites[0].site.contractor"   maxlength="16" datatype="*" value=""/>
						       	   	</td>
						       	   	<td class="table-td" width="15%">
						       	   		<input id="receive_contractPhone_1" type="text"	style="width:90%" class="input-text" name="shipOrderReceiveSites[0].site.contractPhone"  maxlength="16" datatype="m|phone" value=""/>
						       	   	</td>
					     	 	</tr>
				     	 	</table>
				     	 </td>
					</tr>

					 <tr>
				     	<td  colspan="8">
				     	 	<table id="goods_Tab" class="table-form" width="100%">
				     	 		<tr rowspan="2"><td class="table-th" colspan="8" align="center">货物基本信息</td></tr>
				     	 		<tr>
					     	 		<td  class="table-th" width="15%">货物名称 <span style="margin:5px;" >
					     	 			<a href="javascript:void(0);" onclick="javascript:add();" style="color:red;font-size:16px; text-decoration:none;">+</a></span>
					     	 	    </td>
					     	 		<td class="table-th" width="15%" align="center">国际代码</td>
					     	 		<td class="table-th" width="15%" align="center">代码</td>
					     	 		<td class="table-th" width="15%" align="center">件数</td>
					     	 		<td class="table-th" width="10%" align="center">重量(Kg)</td>
					     	 		<td class="table-th" width="10%" align="center">体积(M³)</td>
					     	 		<td class="table-th" width="10%" align="center">运费</td>
					     	 		<td class="table-th" width="10%" align="center">应急方案  操作 </td>
					     	 	</tr>
						     	 	<tr id="1">
						     	 		<td class="table-td"   width="15%">
						     	 			 <input type="hidden" id="goodsId_1" name="shipOrderGoods[0].goods.id" value="" />
						           			 <input type="hidden" id="hid_goodsName"   value="" />
						       	   			 <span id="sp_goods_1"/>
						     	 		</td>
						     	 		<td class="table-td"  width="15%">
						     	 			<input type="text"   class="input-text" id="internatCode_1" name="internatCode"  style="width:80%;" value="${item.goods.category.internatCode }" maxlength="10" readonly="readonly"/>
						     	 		</td>
						     	 		<td class="table-td"  width="15%">
						     	 			<input type="text"  class="input-text" id="code_1" name="code"  style="width:80%;" value="${item.goods.category.code }" maxlength="10"  ignore="ignore" readonly="readonly"/>
						     	 		</td>
						     	 		<td class="table-td"  width="10%">
						     	 			<input type="text"  class="input-text"  id="shipNum_1" name="shipOrderGoods[0].shipNum"  datatype="floatNumTwo"  style="width:60%;"  ignore="ignore"  maxlength="10" />
						     	 		</td>
						     	 		<td class="table-td"  width="10%">
						     	 			<input type="text"　class="input-text" id="shipWeight_1" name="shipOrderGoods[0].shipWeight"  style="width:60%;"   maxlength="10" datatype="floatNumTwo" ignore="ignore"/>
						     	 		</td>
						     	 		<td class="table-td"  width="10%">
						     	 			<input type="text" class="input-text" id="shipVolume_1" name="shipOrderGoods[0].shipVolume"  style="width:60%;"   maxlength="10" datatype="floatNumTwo" ignore="ignore"/>
						     	 		</td>
						     	 		<td class="table-td"  width="10%">
						     	 			<input type="text"   class="input-text" id="shipFee_1" name="shipOrderGoods[0].shipFee"  style="width:60%;"   maxlength="10" datatype="floatNumTwo" ignore="ignore"/>
						     	 		</td>
						     	 		<td class="table-td"  width="15%">
						     	 			<span id="safetCard_sp_1">
						     	 				<c:choose>
							     	 			<c:when test="${not empty shipOrderGoods[0].goods.safetyCard.path }">
									       	   		<a href="javascript:void(0);" onclick="javascript:shipperForm.openSafetyCardView('1','${shipOrderGoods[0].goods.safetyCard.path}')">应急方案</a>
									       	   	</c:when>
									       	   	<c:otherwise>应急方案</c:otherwise>
									       	   	</c:choose>
									       	   	<span id="sp_content_1">
								       	   		<img id="safetyCard_photo_img_1" src="${ctx}/upload/${shipOrderGoods[0].goods.safetyCard.path}" style="display:none;width:100%;height:auto;"/>
								       	   		<span id="safetyCard_attach_sp_1" style="display:none;" />
								       	   		</span>
								       	   	</span>
						     	 		</td>
						     	 	</tr>
				     	 	</table>
				     	 </td>
				     </tr>
					<tr>
						<td colspan="8">
							<table class="table-form" width="100%">
								<tr rowspan="2">
									<td class="table-th" colspan="10" align="center">车辆信息</td>
								</tr>
								<tr>
									<td width="10%" colspan="2" class="table-th" align="center">车牌号</td>
									<td class="table-td" width="10%">
										<input type="hidden" id="carId" name="car.id" value="${entity.car.id }" />
										<input type="hidden" id="hid_licenseNum" value="${entity.car.licenseNum }" value="${entity.car.licenseNum }" />
										<span id="sp_car" /></td>
									<td  width="10%" class="table-th" align="center">半挂车</td>
									<td   class="table-td" width="10%">
										<input type="text" id="licenseNum2" class="input-text" style="width: 90%;" value="${entity.car.licenseNum2 }" readonly="readonly" />
									</td>
								   <td width="10%"  colspan="2" class="table-th" align="center">车辆类型</td>
								   <td class="table-td" width="10%">
								   		<input type="text" id="carType" class="input-text" style="width: 80%; margin-left:10px;" value="${entity.car.carCategory.name }" readonly="readonly" />
								   </td>
								    <td class="table-th" width="10%" align="center">载质量(Kg)</td>
								    <td class="table-th" width="10%">
								   		<input type="text" id="carryCapacity" name="carryCapacity" class="input-text" style="width: 80%; margin-left:10px;" value="${entity.carryCapacity }" datatype="floatNumTwo" />
								   </td>
								</tr>
								<tr>
									<td rowspan="5" width="2%" class="table-th" width>驾驶员信息</td>
									<td class="table-th">姓名</td>
									<td class="table-td"><input type="hidden"
										id="hid_driver_name" name="driverName"
										value="${entity.driverName }" /> <input type="hidden"
										id="hid_driver_id" name="driverId" value="${entity.driverId }" />
										<span id="sp_driver" /></td>
									<td class="table-td" rowspan="5" colspan="2"><c:choose>
											<c:when test="${not empty driver.photo }">
												<img id="driver_photo" src="${ctx}/upload/${driver.photo}"
													style="width: 95%; height: 150px;" />
											</c:when>
											<c:otherwise>
												<img id="driver_photo" src="${ctx}/images/organ/nophoto.gif"
													style="width: 95%; height: 150px;" />
											</c:otherwise>
										</c:choose></td>
									<td rowspan="5" width="2%" class="table-th" width>押运员信息</td>
									<td class="table-th">姓名</td>
									<td class="table-td"><input type="hidden"
										id="hid_escort_name" name="escortName"
										value="${entity.escortName}" /> <input type="hidden"
										id="hid_escort_id" name="escortId" value="${entity.escortId}" />
										<span id="sp_escort" /></td>

									<td class="table-td" rowspan="5" colspan="2"><c:choose>
											<c:when test="${not empty escort.photo }">
												<img id="escort_photo" src="${ctx}/upload/${escort.photo}"
													style="width: 95%; height: 150px;" />
											</c:when>
											<c:otherwise>
												<img id="escort_photo" src="${ctx}/images/organ/nophoto.gif"
													style="width: 95%; height: 150px;" />
											</c:otherwise>
										</c:choose></td>
								</tr>
								<tr>
									<td class="table-th">身份证号</td>
									<td class="table-td"><input type="text"
										id="driver_idno" class="input-text" style="width: 90%;"
										value="${driver.idno}" readonly="readonly" /></td>
									<td class="table-th">身份证号</td>
									<td class="table-td"><input type="text" id="escort_idno"
										class="input-text" style="width: 90%;" value="${escort.idno }"
										readonly="readonly" /></td>
								</tr>
								<tr>
									<td class="table-th">驾驶证号</td>
									<td class="table-td" width="15%"><input type="text"
										id="driver_driverLiceseNum" 　  class="input-text"
										style="width: 90%;" value="${driver.driverLiceseNum }"
										readonly="readonly" /></td>
									<td class="table-th">从业资格证号</td>
									<td class="table-td" width="15%"><input type="text"
										id="escort_superCargoNum" class="input-text"
										style="width: 90%;" value="${escort.superCargoNum }"
										readonly="readonly" /></td>
								</tr>
								<tr>
									<td class="table-th">从业资格证号</td>
									<td class="table-td"><input type="text"
										id="driver_superCargoNum" class="input-text"
										style="width: 90%;" value="${driver.superCargoNum }"
										readonly="readonly" /></td>
									<td class="table-th">联系电话</td>
									<td class="table-td" width="15%"><input type="text"
										id="escort_contractPhone" class="input-text"
										style="width: 90%;" value="${driver.contractPhone }"
										readonly="readonly" /></td>
								</tr>
								<tr>
									<td class="table-th">联系电话</td>
									<td class="table-td"><input type="text"
										id="driver_contractPhone" class="input-text"
										style="width: 90%;" value="${escort.contractPhone }"
										readonly="readonly" /></td>
									<td class="table-th"></td>
									<td class="table-td" width="15%"></td>
								</tr>
							</table>
						</td>
					</tr>


				</tbody>
			</table>
			<input type="hidden" id="id" name="id" value="${entity.id}" />
			<input type="hidden" id="companyId" name="companyId" value="${currentUser.person.companyId}" />
		</form>
	</div>
	<script type="text/javascript" src="${ctx}/js/extjs/ux/ResetDateField.js"></script>
   <script type="text/javascript" src="${ctx}/js/extjs/ux/datetimefield/Spinner.js"></script>
  <script type="text/javascript" src="${ctx}/js/extjs/ux/datetimefield/SpinnerField.js"></script>
　<script type="text/javascript" src="${ctx}/js/extjs/ux/datetimefield/DateTimeField.js"></script>
  <script type="text/javascript" src="${ctx}/js/app-web/biz/shipOrder/shipOrderForm2.js"></script>
  <script type="text/javascript" src="${ctx}/js/public/area-jquery.js"></script>
   <script>
	$.areaInitByJson('${ctx}/area/areaList.action');
	$("#sendProvince").areaSelectedText();
	$("#receiveProvince").areaSelectedText();
	$('#sendCity').areaCascadeByJson('sendProvince','${ctx}/area/areaList.action');
	$('#receiveCity').areaCascadeByJson('receiveProvince','${ctx}/area/areaList.action');
	$("#sendArea").areaCascadeByJson('sendCity','${ctx}/area/areaList.action');
	$("#receiveArea").areaCascadeByJson('receiveCity','${ctx}/area/areaList.action');
  </script>
  </body>
  </html>
  